package com.example.demo.thread;

public class Producer {
    private Depository depository;

    public Producer(Depository depository) {
        this.depository = depository;
    }

    public void produce(Integer id, final int count) {
        new Thread() {
            public void run() {
                try {
                    depository.product(id, count);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }.start();
    }
}
